/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mahumLogs.Bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 *
 * @author Edouard
 */
@Entity
public class Machine implements Serializable {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int idMachine;
    
    private String adresseMAC;
    private String adresseIP;
    private String libelle;
    
    @OneToMany(mappedBy = "Machine",cascade = CascadeType.PERSIST)
    private List<Log> listeLogs = new ArrayList<>();
    
    @ManyToOne(cascade = CascadeType.PERSIST)
    @JoinColumn(name = "FK_ETUDIANT",insertable = false,updatable = false)
    private Etudiant etudiant = new Etudiant();
    
    @ManyToOne(cascade = CascadeType.PERSIST)
    @JoinColumn(name = "FK_TYPEMACHINE",insertable = false,updatable = false)
    private TypeMachine typeMachine = new TypeMachine();

    public Machine() {
    }

    public int getIdMachine() {
        return idMachine;
    }

    public void setIdMachine(int idMachine) {
        this.idMachine = idMachine;
    }

    public String getAdresseMAC() {
        return adresseMAC;
    }

    public void setAdresseMAC(String adresseMAC) {
        this.adresseMAC = adresseMAC;
    }

    public String getAdresseIP() {
        return adresseIP;
    }

    public void setAdresseIP(String adresseIP) {
        this.adresseIP = adresseIP;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    public List<Log> getListeLogs() {
        return listeLogs;
    }

    public void setListeLogs(List<Log> listeLogs) {
        this.listeLogs = listeLogs;
    }

    public Etudiant getEtudiant() {
        return etudiant;
    }

    public void setEtudiant(Etudiant etudiant) {
        this.etudiant = etudiant;
    }

    public TypeMachine getTypeMachine() {
        return typeMachine;
    }

    public void setTypeMachine(TypeMachine typeMachine) {
        this.typeMachine = typeMachine;
    }
    
    
    
    
}
